/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#ifndef __GameWorld_H__
#define __GameWorld_H__

#include "Ogre.h"
#include <OIS/OIS.h>

#include "SinbadCharacter.h"

namespace OgreCamNav
{
	class GameWorld
		: public OIS::MouseListener, public OIS::KeyListener
	{
	protected:
		GameWorld(void);
		~GameWorld(void);
		
		Ogre::Root *_root;
		Ogre::RenderWindow *_win;
		Ogre::SceneManager *sceneMgr;
		Ogre::Camera *camera;

		SinbadCharacter *character;

		bool rightMouseDown;
		void createMainCharacter();
	protected:
		bool keyPressed( const OIS::KeyEvent &e );
		bool keyReleased( const OIS::KeyEvent &e );

		bool mouseMoved( const OIS::MouseEvent &e );
		bool mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id );
		bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id );

	public:
		static GameWorld &getSingleton();
		void init(Ogre::RenderWindow* win);
		void update(float deltaT);

		void setupViewport();
		void setupScene();
		void setupGUI();
		void setupInputListener();


	};
}
#endif
